@use '../../../styles';
@use '../../../themes/defaults';

.jse-tree-mode {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: defaults.$background-color;
  min-width: 0;
  min-height: 0;
  font-family: defaults.$font-family-mono;
  font-size: defaults.$font-size-mono;
  color: defaults.$text-color;
  line-height: defaults.$line-height;

  .jse-hidden-input-label {
    .jse-hidden-input {
      position: fixed;
      top: -10px;
      left: -10px;
      // important: width and height must be larger than zero, else Safari gives problems: scrolls to top when the editor gets focus, see https://github.com/josdejong/svelte-jsoneditor/issues/238
      width: 1px;
      height: 1px;
      padding: 0;
      border: 0;
      outline: none;
    }
  }

  &.no-main-menu {
    border-top: defaults.$main-border;
  }

  .jse-search-box-container {
    position: relative;
    height: 0;
    top: defaults.$padding;
    margin-right: calc(defaults.$padding + 20px);
    margin-left: defaults.$padding;
    text-align: right;
    z-index: 3; // must be above the ContextMenuButton
  }

  .jse-contents {
    flex: 1;
    overflow: auto;
    position: relative;
    padding: styles.$contents-padding;
    display: flex;
    flex-direction: column;
    border-left: defaults.$main-border;
    border-right: defaults.$main-border;

    &:last-child {
      border-bottom: defaults.$main-border;
    }

    .jse-loading-space {
      flex: 1;
    }

    .jse-loading {
      flex: 2;
      text-align: center;
      color: defaults.$panel-color-readonly;
      box-sizing: border-box;
      font-family: defaults.$font-family;
      font-size: defaults.$font-size;
    }

    .jse-search-box-background {
      $search-box-height: 100px;
      border: calc($search-box-height / 2) solid defaults.$modal-background;
      margin: -(styles.$contents-padding);
      margin-bottom: styles.$contents-padding;
      display: inline-block;
    }
  }
}
